﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--Data template for displaying a database item to select-->
    <DataTemplate x:Key="SelectableDatabase">
        <CheckBox IsChecked="{Binding Selected}" Content="{Binding DatabaseName}"/>
    </DataTemplate>

    <!--Data template for displaying a query view item to select-->
    <DataTemplate x:Key="SelectableQueryView">
        <CheckBox IsChecked="{Binding SelectedForSaving}" Content="{Binding QueryName}"/>
    </DataTemplate>
    
    <!--Data template for displaying a database result set to select-->
    <DataTemplate x:Key="SelectableResultSet">
        <CheckBox IsChecked="{Binding Result.SelectedForExport}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding DatabaseServer.ServerName}"/>
                <TextBlock Text=" - "/>
                <TextBlock Text="{Binding DatabaseName}"/>
            </StackPanel>
        </CheckBox>
    </DataTemplate>
    
    <!--Data template for displaying server plugin item to select-->
    <DataTemplate x:Key="SelectablePlugin">
        <Label Content="{Binding Value}"/>
    </DataTemplate>

    <!--Style for images in buttons so that the image will appear greyed out when the
        button is disabled-->
    <Style TargetType="{x:Type Image}" x:Key="buttonImage">
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, Mode=FindAncestor}, Path=IsEnabled}" Value="False">
                <Setter Property="Opacity" Value="0.50"></Setter>
            </DataTrigger>
        </Style.Triggers>

        <!--Add a small space bewteen the icon and the button text-->
        <Setter Property="Margin" Value="0,0,5,0"/>
    </Style>

    <!--Style for images in menus so that the image will appear greyed out when the
        menu is disabled-->
    <Style TargetType="{x:Type Image}" x:Key="menuImage">
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuItem}, Mode=FindAncestor}, Path=IsEnabled}" Value="False">
                <Setter Property="Opacity" Value="0.50"></Setter>
            </DataTrigger>
        </Style.Triggers>
        
        <!--Add a small space bewteen the icon and the Menu text-->
        <Setter Property="Margin" Value="0,0,5,0"/>
    </Style>
    
    <!--Default styling for command buttons-->
    <Style TargetType="{x:Type Button}">
        <Setter Property="MinWidth" Value="70"/>
        <Setter Property="Margin" Value="5"/>
    </Style>
    
    <!--Style for buttons that contain only 16x16 icons-->
    <Style TargetType="{x:Type Button}" x:Key="iconButton">
        <Setter Property="Margin" Value="5"/>
    </Style>
        
    <!--Styling for lables, combos and text boxes in dialogs-->
    <Style TargetType="{x:Type Label}" x:Key="dialogLabel">
        <Setter Property="Margin" Value="0,5,0,0"/>
    </Style>
    <Style TargetType="{x:Type TextBox}" x:Key="dialogTextbox">
        <Setter Property="Margin" Value="0,5,5,0"/>
    </Style>
    <Style TargetType="{x:Type ComboBox}" x:Key="dialogCombo">
        <Setter Property="Margin" Value="0,5,5,0"/>
    </Style>
    
    <!--Server details group box used in diaglogs-->
    <Style TargetType="{x:Type GroupBox}" x:Key="serverDetails">
        <Setter Property="Margin" Value="5"/>
    </Style>
    
    <!--Windows Authentication check box used in dialogs-->
    <Style TargetType="{x:Type CheckBox}" x:Key="winAuth">
        <Setter Property="Margin" Value="5,15,5,0"/>
    </Style>
</ResourceDictionary>